from selenium.webdriver.common.by import By

byid = By.ID
byname = By.NAME
bycname = By.CLASS_NAME
bytname = By.TAG_NAME
bylink = By.LINK_TEXT
bycss = By.CSS_SELECTOR
byxpath = By.XPATH
byparriallike = By.PARTIAL_LINK_TEXT

"""支付管理页面"""
payment_manage_click = byxpath, '/html/body/div[1]/div[2]/div[2]/div[2]/div[7]/h2'


class PaymentProduct:
    # 支付产品信息
    payment_info_click = byxpath, '/html/body/div[1]/div[2]/div[2]/div[2]/div[8]/ul/li[1]/div/a'
    # 添加支付产品
    add_product = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[2]/div[2]/div[1]/ul/li[1]/a/span'
    # 支付产品编码
    product_number = bycss, '#navTab > div.navTab-panel.tabsPageContent.layoutBox > div:nth-child(4) > div > form > div.tabsContent.pageFormContent > div > fieldset > dl:nth-child(2) > dd > input'
    # 支付产品名称
    product_name = bycss, '/html/body/div[1]/div[3]/div/div[2]/div[4]/div/form/div[1]/div/fieldset/dl[2]/dd/input'
    # 提交
    submit_btn = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[7]/div/form/div[2]/ul/li[1]/div/div/button'
    # 断言支付产品编码
    dy_product_number = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[6]/div[2]/div[2]/div[2]/div/table/tbody/tr[1]/td[2]/div'
    # 设置支付方式
    set_way = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[6]/div[2]/div[2]/div[2]/div/table/tbody/tr[1]/td[6]/div/a[1]'
    # 点击设置支付方式
    set_way_click = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[7]/div[2]/div[1]/ul/li[1]/a/span'
    # 支付汇率
    payment_hl = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[8]/div/form/div[1]/div/fieldset/dl[3]/dd/input'
    # 设置支付方式的提交
    set_way_submit_btn = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[8]/div/form/div[2]/ul/li[1]/div'
    # 断言费率
    dy_fl = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[7]/div[2]/div[2]/div[2]/div/table/tbody/tr/td[6]/div'
    # 上架
    add_grounding = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[6]/div[2]/div[2]/div[2]/div/table/tbody/tr[1]/td[6]/div/a[2]'
    # 确定
    sure_btn = byxpath, '/html/body/div[16]/div[1]/div/div[2]/ul/li[1]/a/span'
    # 断言是否上架成功
    dy_sure = byxpath, '/html/body/div[16]/div[1]/div/div[1]/div'
    # 确定上架或上架失败
    sure_btn_grounding = byxpath, '/html/body/div[16]/div[1]/div/div[2]/ul/li/a/span'


payment_product = PaymentProduct()


class UserPayment:
    # 支付产品信息
    user_payment_click = byxpath, '/html/body/div[1]/div[2]/div[2]/div[2]/div[8]/ul/li[2]/div/a'


user_payment = PaymentProduct()